﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Huirui.Cavan.Domain.MainBoundedContext.SystemModule;
using Huirui.Cavan.Domain.Seedwork;
using Huirui.Cavan.Core.Extension;

namespace Huirui.Cavan.Domain.MainBoundedContext.StockModule
{
    public class StockCheck : Persistent<string>
    {
        protected DateTime _checkDate;
        protected WareHouse _wareHouse;
        protected Corporation _corporation;
        protected string _productionNumber;
        protected string _remark;
        protected IList<StockCheckDetail> _stockCheckDetails;

        public StockCheck()
        { 
        }

        public StockCheck(string id, DateTime checkDate, WareHouse wareHouse, string productionNumber, string remark, DateTime createDate, DateTime modifyDate, int editUser, Corporation corporation)
        {
            this.Id = id;
            this._checkDate = checkDate;
            this._wareHouse = wareHouse;
            this._productionNumber = productionNumber;
            this._remark = remark;
            this._createDate = createDate;
            this._modifyDate = modifyDate;
            this._editUser = editUser;
            this._corporation = corporation;
        }

        public virtual DateTime CheckDate
        {
            get { return _checkDate; }
            set { _checkDate = value; }
        }

        public virtual Corporation Corporation
        {
            get { return _corporation; }
            set { _corporation = value; }
        }

        public virtual WareHouse WareHouse
        {
            get { return _wareHouse; }
            set { _wareHouse = value; }
        }

        public virtual string ProductionNumber
        {
            get { return _productionNumber; }
            set { _productionNumber = value; }
        }

        public virtual string Remark
        {
            get { return _remark; }
            set { _remark = value; }
        }

        public virtual IList<StockCheckDetail> StockCheckDetails
        {
            get 
            {
                if (_stockCheckDetails.IsNull())
                {
                    _stockCheckDetails = new List<StockCheckDetail>();
                }
                return _stockCheckDetails;
            }
            set
            {
                _stockCheckDetails = value;
            }
        }
    }
}
